package com.yyks.es.dubbo.pojo.vo.search;

import cn.hutool.core.collection.CollectionUtil;
import com.yyks.es.dubbo.pojo.vo.HotelInfoHotelSearchVoHotleForApp;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class HotelInfoHotelSearchVoForApp {

    List<HotelInfoHotelSearchVoHotleForApp> list;

    public static HotelInfoHotelSearchVoForApp covertHotelInfoHotelSearchVo(HotelInfoHotelUnionSearchVo hotelInfoHotelUnionSearchVo) {
        HotelInfoHotelSearchVoForApp hotelInfoHotelSearchVoForApp = new HotelInfoHotelSearchVoForApp();
        List<HotelInfoHotelUnionSearchVoHotle> hotelInfoHotelUnionSearchVoList = hotelInfoHotelUnionSearchVo.getList();
        ArrayList<HotelInfoHotelSearchVoHotleForApp> hotelInfoHotelSearchVoHotleForApps = new ArrayList<>();
        if (CollectionUtil.isNotEmpty(hotelInfoHotelUnionSearchVoList)) {
            for (HotelInfoHotelUnionSearchVoHotle hotelInfoHotelUnionSearchVoHotle : hotelInfoHotelUnionSearchVoList) {
                HotelInfoHotelSearchVoHotleForApp hotelInfoHotelSearchVoHotleForApp = new HotelInfoHotelSearchVoHotleForApp();
                hotelInfoHotelSearchVoHotleForApp.setSourceId(hotelInfoHotelUnionSearchVoHotle.getSourceId());
                hotelInfoHotelSearchVoHotleForApp.setName(hotelInfoHotelUnionSearchVoHotle.getName());
                hotelInfoHotelSearchVoHotleForApp.setPositionX(hotelInfoHotelUnionSearchVoHotle.getPositionX());
                hotelInfoHotelSearchVoHotleForApp.setPositionY(hotelInfoHotelUnionSearchVoHotle.getPositionY());
                hotelInfoHotelSearchVoHotleForApp.setDistance(hotelInfoHotelUnionSearchVoHotle.getDistance());
                hotelInfoHotelSearchVoHotleForApp.setMinPrice(hotelInfoHotelUnionSearchVoHotle.getMinPrice());
                hotelInfoHotelSearchVoHotleForApp.setSourceType(hotelInfoHotelUnionSearchVoHotle.getSourceType());
                hotelInfoHotelSearchVoHotleForApps.add(hotelInfoHotelSearchVoHotleForApp);
            }
        }
        hotelInfoHotelSearchVoForApp.setList(hotelInfoHotelSearchVoHotleForApps);
        return hotelInfoHotelSearchVoForApp;
    }

}
